﻿@{
    ViewBag.Title = "Home Page";
}

<div>
    <p>class名称</p>
    <input id="className" value="Test.TestCla" />
</div>

<div>
    <p>dll名称</p>
    <input id="dllName" value="Test" />
</div>

<div>
    <p>action名称</p>
    <input id="funName" value="saidBye" />
</div>

<div>
    <p>cron表达式</p>
    <input id="cron" value="*/5 * * * * *" />
</div>
<div><button id="action" onclick="startClick()"> 执行</button><button id="stop" onclick="stopClick()"> 停止</button></div>
@*<script src="~/Scripts/jquery-3.4.1.js"></script>*@
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
    var startClick = function () {
        $.ajax({
            url: '/Home/AddJob',
            type: 'post',
            data: {
                className: $('#className').val(),
                dllName: $('#dllName').val(),
                funName: $('#funName').val(),
                cron: $('#cron').val()
            },
            success: function (data) {
                console.log(data);
            }
        });
    }
    var stopClick = function () {
        $.ajax({
            url: '/Home/RemoveJob',
            type: 'post',
            data: {
                className: $('#className').val(),
                dllName: $('#dllName').val(),
                funName: $('#funName').val() 
            },
            success: function (data) {
                console.log(data);
            }
        });
    }


    
</script>

@*<div class="jumbotron">
        <div class="col-md-4">
            <p>@ViewBag.SayHello</p>
            <p>@ViewBag.SayBye</p>
        </div>
    </div>*@

